<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //与数组结构相同，有一一对应的方式
        let person = {
            pname: '胡',
            age: 18,
            weight: 100
        }
        // let { pname, age, weight } = person;
        // console.log(pname);
        // console.log(age);
        // console.log(weight);

        //另一种写法
        let { pname: myName, age: myAge, weight: myWeight } = person;
        console.log(myName);
        console.log(myAge);
        console.log(myWeight);
    </script>
</body>

</html>